<script>
import AuditBase from '../index'

export default {
  name: 'auditLog',
  extends: AuditBase,
  data () {
    return {
      api: 'findAuditLogByFuzzyPage',
      // 查询条件
      searchConfig: {
        items: [
          {
            key: 'module',
            title: '所属模块'
          },
          {
            key: 'type',
            title: '操作类型'
          },
          {
            key: 'username',
            title: '用户名'
          },
          {
            key: 'status',
            title: '状态',
            type: 'select',
            placeholder: '请选择',
            groups: this.$store.state.dic.listFormat['state']
          },
          {
            key: 'createTime',
            title: '创建时间',
            type: 'daterange',
            startPlaceholder: '请选择',
            endPlaceholder: '请选择'
          }
        ],
        search: params => {
          this.search(params)
        },
        reset: () => {
          this.reset()
        },
        params: {}
      },
      searchData: {
        module: '',
        type: '',
        username: '',
        startTime: '',
        endTime: ''
      },
      // 列表
      tableConfig: {
        columns: [
          {
            title: '序号',
            type: 'index',
            width: '50'
          },
          {
            title: '所属模块',
            key: 'module'
          },
          {
            title: '操作类型',
            key: 'type'
          },
          {
            title: '用户名',
            key: 'username'
          },
          {
            title: '请求ip地址',
            key: 'ip'
          },
          {
            title: '描述',
            key: 'descr'
          },
          {
            title: '状态',
            key: 'status',
            formatType: row => this.GLOBAL.formatter.formatTableCol(row.status, 'state')
          },
          {
            title: '创建时间',
            key: 'createTime',
            width: '170px',
            formatType: row => this.GLOBAL.formatter.formatDateTime(row.createTime, 'YYYY-MM-DD hh:mm:ss')
          },
          {
            title: '业务ID',
            key: 'businessId'
          }
        ],
        tableData: []
      }
    }
  }
}
</script>
